package com.medical.service;

import com.medical.common.PageResult;
import com.medical.entity.Appointment;

import java.time.LocalDate;
import java.util.List;

/**
 * 专家门诊预约服务接口
 */
public interface AppointmentService {
    
    /**
     * 创建预约
     */
    Appointment createAppointment(Appointment appointment);
    
    /**
     * 更新预约状态
     */
    Appointment updateAppointmentStatus(Long appointmentId, String status);
    
    /**
     * 根据ID查询预约
     */
    Appointment getAppointmentById(Long id);
    
    /**
     * 根据预约单号查询
     */
    Appointment getAppointmentByNo(String appointmentNo);
    
    /**
     * 分页查询预约记录
     */
    PageResult<Appointment> getAppointments(int page, int size, Long patientId, Long doctorId, String status);
    
    /**
     * 查询患者预约记录
     */
    List<Appointment> getPatientAppointments(Long patientId);
    
    /**
     * 查询医生预约记录
     */
    List<Appointment> getDoctorAppointments(Long doctorId);
    
    /**
     * 查询指定日期的预约记录
     */
    List<Appointment> getAppointmentsByDate(LocalDate date, Long doctorId);
    
    /**
     * 取消预约
     */
    Appointment cancelAppointment(Long appointmentId, String reason);
    
    /**
     * 检查预约冲突
     */
    boolean checkAppointmentConflict(LocalDate date, String timeSlot, Long doctorId);
    
    /**
     * 获取可用时间段
     */
    List<String> getAvailableTimeSlots(LocalDate date, Long doctorId);
}
